home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / demos / bitmaprotation / zoom.s next >
Text File  |  1980-01-03  |  15KB  |  755 lines

  1. ************************************************************************
  2. * 4-Bitplane-Zoom-Routine    (C) May 1991 by the WEAPONMASTER/CYTAX    *
  3. * Release in I.C.E. Issue #5                                           *
  4. ************************************************************************
  5. * I programmed this routine after I saw Sanity's 'Elysium'-demo.       *
  6. * It wasn't my original intention to publish this sourcecode, so I     *
  7. * didn't comment the routines in the way as I would do, if the source- *
  8. * code should be released. For this reason nearly all comments are in  *
  9. * German, but I decided to publish it, because a lot of coders wanted  *
  10. * a copy from me.  The important routines are partially optimised, but *
  11. * not the routines for display-, start-initialization and main-loop.   *
  12. * I didn't want to waste much time, so I used parts of my older        *
  13. * productions for controlling the important routines.                  *
  14. ************************************************************************
  15.  
  16. * If you want to contact me for any reason write to the I.C.E. address
  17. * but mark your sending, that the other Cytax-members will notice
  18. * that they should give it to me.
  19. * (e.g. add something like: 'to Weaponmaster' or 'to WPM.')
  20.  
  21. * For 'zooming' press left Mouse-Button, right MB for exit
  22. * The sourcecode originally worked with 'Seka V3.2', Source Modified to work
  23. * with ASM-One / Devpac (or compatibles)..
  24.  
  25. ;Macro for blitter waiting..
  26.  
  27. waitblit    macro
  28. \@wblit        btst    #14,(A5)
  29.         bne.s    \@wblit
  30.         endm
  31.  
  32.         section    chippy,code_c
  33.  
  34. start:    move.l 4.w,a6
  35.     jsr -132(a6)            ;Forbid (eigentlich nicht notwendig,
  36.                 ;da IRQs später aus)
  37.     lea grname,a1
  38.     jsr -408(a6)
  39.     move.l d0,graphicsbase
  40.     beq error
  41.  
  42.     lea $dff002,a5
  43.     move.w $1a(a5),intenaold
  44.     move.w #$7fff,$98(a5)        ;IRQs aus
  45.  
  46.     move.w #$03f0,$94(a5)
  47.     move.w #$2c81,$8c(a5)
  48.     move.w #$f5c1,$8e(a5)
  49.     move.w #$38,$90(a5)
  50.     move.w #$d0,$92(a5)
  51.     move.w #$4200,$fe(a5)
  52.     move.w #0,$100(a5)
  53.  
  54.     move.w #$2c07,d0
  55.     move.w #$fffe,d1
  56.     move.l #$01080078,d2
  57.     move.l #$010a0078,d3
  58.     move.w #$100,d4
  59.     move.w #$f507,d5
  60.     lea cpl_mod-6,a0
  61.  
  62. cop_init1:
  63.     move.w d0,(a0)+
  64.     move.w d1,(a0)+
  65.     move.l d2,(a0)+
  66.     move.l d3,(a0)+
  67.     add.w  d4,d0
  68.     cmp.w d5,d0
  69.     blo.s cop_init1
  70.  
  71.     lea col1,a0
  72.     lea $17e(a5),a1
  73.     move.w #$f,d0
  74. cop_init2:
  75.     move.w (a0)+,(a1)+
  76.     dbf d0,cop_init2
  77.  
  78.     move.l #cladr,$7e(a5)
  79.     move.w #0,$86(a5)
  80.  
  81.     move.l #planes1,planeakt
  82.     move.l #planes2,planeverd
  83.     clr.w bildnr
  84.  
  85.     move.l planeakt,d0
  86.     move.w d0,cladr+2
  87.     swap d0
  88.     move.w d0,cladr+6
  89.     swap d0
  90.     add.l #40,d0
  91.     move.w d0,cladr+10
  92.     swap d0
  93.     move.w d0,cladr+14
  94.     swap d0
  95.     add.l #40,d0
  96.     move.w d0,cladr+18
  97.     swap d0
  98.     move.w d0,cladr+22
  99.     swap d0
  100.     add.l #40,d0
  101.     move.w d0,cladr+26
  102.     swap d0
  103.     move.w d0,cladr+30
  104.  
  105.     move.w #$87c0,$94(a5)
  106.  
  107.     bsr tabinit
  108.     bsr hauptprogramm
  109.  
  110.     move.w #$03f0,$94(a5)
  111.  
  112.     move.w intenaold,d0
  113.     bset #15,d0
  114.     move.w d0,$98(a5)
  115.     move.l graphicsbase,a1
  116.     move.l 38(a1),$7e(a5)
  117.     move.w #0,$86(a5)
  118.     jsr -414(a6)
  119.     move.w #$83f0,$94(a5)
  120. error:
  121.     jsr -138(a6)
  122.     clr.l d0
  123.     rts
  124.  
  125. intenaold: dc.w 0
  126.  
  127. hauptprogramm:
  128.     clr.w bildnr
  129.  
  130. ranzoomen:
  131.     btst #10,$14(a5)
  132.     beq ende
  133.     btst #6,$bfe001
  134.     bne.s ranzoomen
  135.  
  136.     move.w bildnr,d0
  137.     move.l planeakt,a0
  138.     lea 160(a0),a0
  139.     move.l planeverd,a1
  140.     lea 160(a1),a1
  141.     lea origpic,a4
  142.     bsr vergroessern
  143.     bsr umschalten
  144.     addq.w #1,bildnr
  145.     cmpi.w #160,bildnr
  146.     blt.s ranzoomen
  147.  
  148.     subq.w #1,bildnr
  149.  
  150.     move.l #$30000,d0
  151. verz:
  152.     subq.l #1,d0
  153.     bne.s verz
  154.  
  155. wegzoomen:
  156.     btst #10,$14(a5)
  157.     beq ende
  158.     btst #6,$bfe001
  159.     bne.s wegzoomen
  160.  
  161.     move.w bildnr,d0
  162.     move.l planeakt,a0
  163.     lea 160(a0),a0
  164.     move.l planeverd,a1
  165.     lea 160(a1),a1
  166.     bsr verkleinern
  167.     bsr umschalten
  168.     subq.w #1,bildnr
  169.     bpl.s wegzoomen
  170.     bra hauptprogramm
  171.  
  172. ende:    rts
  173.  
  174. bildnr: dc.w 0
  175.  
  176. ****************************************************************************
  177.  
  178. umschalten:
  179.     move.l planeakt,d0
  180.     move.l planeverd,d1
  181.     exg d0,d1
  182.     move.l d0,planeakt
  183.     move.l d1,planeverd
  184.  
  185. waitrast:
  186.     move.w 4(a5),d1
  187.     and.w #$ff00,d1
  188.     cmp.w #$f600,d1
  189.     blo.s waitrast
  190.  
  191.     move.w d0,cladr+2
  192.     swap d0
  193.     move.w d0,cladr+6
  194.     swap d0
  195.     add.l #40,d0
  196.     move.w d0,cladr+10
  197.     swap d0
  198.     move.w d0,cladr+14
  199.     swap d0
  200.     add.l #40,d0
  201.     move.w d0,cladr+18
  202.     swap d0
  203.     move.w d0,cladr+22
  204.     swap d0
  205.     add.l #40,d0
  206.     move.w d0,cladr+26
  207.     swap d0
  208.     move.w d0,cladr+30
  209.  
  210.     move.l #cpl_mod,d0
  211.     waitblit
  212.     move.l d0,$52(a5)        ;DPT
  213.     move.w #-40,$72(a5)        ;ADAT
  214.     move.w #10,$64(a5)        ;DMOD
  215.     move.l #$ffffffff,$42(a5)    ;Masken
  216.     move.l #$01f00000,$3E(a5)    ;CON0
  217.     move.w #$3241,$56(a5)        ;SIZE
  218.  
  219.     move.w bildnr,d1
  220.     add.w d1,d1
  221.     add.w d1,d1
  222.     lea    ModTabZeiger,a0
  223.     move.l (a0,d1.w),a0
  224.  
  225.     move.w (a0)+,d1            ;Offset
  226.     move.w (a0)+,d2            ;Anzahl = Blt-Height
  227.     beq.s um_next
  228.  
  229.     lsl.w #6,d2
  230.     addq.w #1,d2            ;Bltsize
  231.  
  232.     ext.l d1
  233.     add.l d0,d1            ;Startadresse.
  234.  
  235.     waitblit
  236.     move.l a0,$4e(a5)        ;APT
  237.     move.l d1,$52(a5)        ;DPT
  238.     move.w #$09f0,$3e(a5)        ;CON0
  239.     move.w #0,$62(a5)        ;AMOD
  240.     move.w d2,$56(a5)        ;Size
  241.  
  242. um_next:
  243.     waitblit
  244.  
  245.     move.l d0,$4e(a5)        ;APT
  246.     addq.l #4,d0
  247.     move.l d0,$52(a5)        ;DPT
  248.     move.w #10,$62(a5)        ;AMOD
  249.     move.w #$09f0,$3E(a5)        ;CON
  250.     move.w #$3241,$56(a5)        ;SIZE
  251.  
  252.     waitblit
  253.     rts
  254.  
  255. **********************************************************************
  256. * Startinitialisierungen der Zoom-Routine                            *
  257. **********************************************************************
  258.  
  259. TabInit:
  260.     lea ZeilenTab(PC),a0
  261.     lea BitTab(PC),a1
  262.  
  263.     moveq #15,d0
  264.  
  265. ti_loop1:
  266.      lea WortTab(PC),a2
  267.      move.w (a1)+,d1
  268.      move.w #9,d2
  269.  
  270. ti_loop2:
  271.       move.w (a2)+,d3
  272.     asl.w #4,d3
  273.     add.w d1,d3
  274.       move.w d3,(a0)+
  275.     dbf d2,ti_loop2
  276.     dbf d0,ti_loop1
  277.  
  278.     lea ArbeitsTab(pc),a0
  279.     move.w #159,d0
  280.     move.w #2000,d1
  281. ti_loop3:
  282.      move.w d1,(a0)+
  283.     dbf d0,ti_loop3
  284.  
  285.     lea ZeilenTab(pc),a0
  286.     lea Einftab(pc),a1
  287.     lea ArbeitsTab(pc),a2
  288.     clr.w d0
  289.  
  290. ti_loop4:
  291.      move.w (a0,d0.w),d1
  292.      moveq #-2,d2
  293.  
  294. ti_loop5:
  295.     addq.w #2,d2
  296.     cmp.w (a2,d2.w),d1
  297.     bgt.s ti_loop5
  298.  
  299.      lea 318(a2),a3
  300.      lea (a2,d2.w),a4
  301.  
  302. ti_loop6:
  303.       move.w -(a3),2(a3)
  304.     cmpa.l a4,a3
  305.     bhi.s ti_loop6
  306.  
  307.      move.w d1,(a4)
  308.  
  309.     lsr.w #1,d2
  310.     move.w d2,(a1)+
  311.     addq.w #2,d0
  312.     cmp.w #160*2,d0
  313.     blo.s ti_loop4
  314.  
  315.     lea VielfachenTab,a2
  316.     clr.w (a2)+
  317.  
  318.     move.w #120,d0
  319.     move.w #160,d1
  320.     move.w #200,d2
  321.  
  322. ti_loop10:
  323.     move.w d0,(a2)+
  324.     add.w d1,d0
  325.     dbf d2,ti_loop10
  326.  
  327. ;Modulotabelle aufbauen
  328.  
  329.     lea modulotab,a0
  330.     lea ModTabZeiger,a1
  331.     lea Vielfachentab,a2
  332.     moveq #1,d7            ;n = Breite /2
  333.  
  334.     move.l a0,(a1)+            ;Offset auf Daten in ModTab für
  335.     move.l #0,(a0)+            ;Bildnr. 0 (nichts sichtbar)
  336.  
  337.  
  338. ti_loop9:
  339.     move.l a0,(a1)+            ;Offset auf Daten in ModTab für
  340.                 ;jeweilige Bildnr.
  341.     moveq #0,d6            ;Register für Coplistoffsets
  342.  
  343.     move.w d7,d0            ;n
  344.     move.w d7,d2
  345.     mulu #$a000,d0
  346.     move.l #$640000,d1
  347.     sub.l d0,d1
  348.     swap d1                ;= erste Zeile, in der Modulos
  349.                 ;aus Tab geschrieben werden
  350.     add.w d1,d1
  351.     add.w d1,d1            ;4*
  352.     add.w d1,d6            ;+
  353.     add.w d1,d1            ;8*
  354.     add.w d1,d6            ;=12* (da     move Mod1; Mod2; Wait =
  355.                 ;(3 CopperBefehle)
  356.     add.l d0,d0
  357.     swap d0                ;= 2n* 200/320 = Höhe
  358.  
  359.     move.l #$a000,d1
  360.     divu d2,d1
  361.     swap d1
  362.     clr.w d1
  363.     lsr.l #8,d1            ;$a000/n * $100  als $10000er-Bruch
  364.  
  365.     moveq #0,d2
  366.     moveq #0,d4
  367.  
  368. ;in d0: Anzahl (eigentlich Anzahl-1 wegen Zeile 0) -> Schleifenvar.
  369. ;in d1: Zähler zum Aufaddieren
  370. ;d2: Aufaddierungsregister
  371. ;d3:
  372. ;d4: Jeweils letzte Zeile
  373. ;d6: Coplistoffset
  374. ;a0: ModTab
  375. ;a1: ModZeiger
  376. ;a2: VielfachenTab
  377.  
  378.     move.w d6,(a0)+            ;Coplistoffset schreiben
  379.     move.w d0,(a0)+            ;Anzahl-1 schreiben
  380.     addq.w #1,-2(a0)        ;+1 = Anzahl (Bltsize-Höhe)
  381.  
  382.     bra.s ti_loop7
  383.  
  384. ti_loop8:
  385.     add.l d1,d2            ;Zähler aufaddieren
  386.     swap d2                ;= i-te Zeile
  387.     move.w d2,d3            ;darzustellende OrigZeile
  388.  
  389.     sub.w d4,d3            ;- letzte OrigZeile = Zeilendifferenz
  390.     add.w d3,d3            ;*2 = VielfachenOffset
  391.  
  392. ;    move.w  d3,(a0)+
  393.     move.w (a2,d3.w),(a0)+        ;Mod aus VfTab nach ModTab schreiben
  394.     move.w d2,d4
  395.     swap d2
  396. ti_loop7:
  397.     dbf d0, ti_loop8
  398.  
  399.     move.w #201,d3            ;Von letzter Zeile (d4) auf OrgZeile 201
  400.     sub.w d4,d3            ;Zeilendifferenz
  401.     add.w d3,d3
  402.     move.w (a2,d3.w),(a0)+
  403. ;    move.w  d3,(a0)+
  404.     addq.w #1,d7
  405.     cmp.w #160,d7
  406.     bls.s ti_loop9
  407.     rts
  408.  
  409. ****************************************************************************
  410. verkleinern:
  411. ****************************************************************************
  412.  
  413. ;A0 Quellpuffer
  414. ;A1 Zielpuffer
  415. ;Bildnr. in d0
  416.  
  417. ;    lea $dff002,a5
  418.  
  419.     add.w d0,d0
  420.     lea EinfTab(pc),a2
  421.     move.w #$9f,d6
  422.     sub.w (a2,d0.w),d6
  423.  
  424.     move.l a0,a2            ;Pufferadr. kopieren
  425.     move.l a1,a3
  426.  
  427.     move.w d6,d7
  428.     not.w d7
  429.     and.w #$f,d7            ;Bitnr. links in   d7
  430.     lsr.w #4,d6            ;Breite-1 in W. in d6
  431.     move.w d6,d5
  432.     add.w d5,d5            ;Breite-2 in B. in d5
  433.  
  434. *** LINKER TEIL
  435.  
  436.     moveq #38,d0
  437.     sub.w d5,d0
  438.     move.w d6,d1
  439.     add.w #$c801,d1
  440.  
  441.     waitblit
  442.     move.l #$fffffffe,$42(a5)    ;FWM,LWM
  443.     movem.l a0/A1,$4E(a5)        ;APT,DPT
  444.     move.w d0,$62(a5)        ;AMOD
  445.     move.w d0,$64(a5)        ;DMOD
  446.     move.l #$19f00000,$3e(a5)    ;CON0,CON1
  447.     move.w d1,$56(a5)        ;SIZE
  448.  
  449. *** LINKER TEIL RECHTES WORT
  450.  
  451.     adda.w d5,a0
  452.     adda.w d5,a1
  453.     clr.w d4
  454.     bset d7,d4
  455.     subq.w #1,d4
  456. ;beq nächste Blitteroperation
  457.     moveq #38,d2
  458.     waitblit
  459.     movem.l a0/a1,$4E(a5)        ;APT,DPT
  460.     move.l a1,$4a(a5)        ;BPT
  461.     move.w d2,$60(a5)        ;BMOD
  462.     move.w d2,$62(a5)        ;AMOD
  463.     move.w d2,$64(a5)        ;DMOD
  464.     move.w #$ffff,$44(a5)        ;LWM
  465.     move.w d4,$6e(a5)        ;CDAT
  466.     move.w #$0de4,$3e(a5)        ;CON0
  467.     move.w #$c801,$56(a5)        ;SIZE
  468.  
  469. *** MITTE
  470.  
  471.     moveq #18,d2
  472.     sub.w d5,d2            ;Breite Mitte in W.
  473.     beq.s vk_nextBlit        ;falls 0, nächste Operation
  474.     moveq #40,d3
  475.     sub.w d2,d3
  476.     sub.w d2,d3
  477.     add.w #$c800,d2
  478.     addq.w #2,a0
  479.     addq.w #2,a1
  480.  
  481.     waitblit
  482.     movem.l a0/a1,$4e(a5)        ;APT,DPT
  483.     move.w d3,$62(a5)        ;AMOD
  484.     move.w d3,$64(a5)        ;DMOD
  485.     move.w #$09f0,$3e(a5)        ;CON0
  486.     move.w d2,$56(a5)        ;SIZE
  487.  
  488. *** RECHTER TEIL
  489.  
  490. vk_nextblit:
  491.     lea $7d00-2(a2),a2
  492.     lea $7d00-2(a3),a3
  493.     waitblit
  494.     movem.l a2/a3,$4E(a5)        ;APT,DPT
  495.     move.w #$7fff,$44(a5)        ;LWM
  496.     move.w d0,$62(a5)        ;AMOD
  497.     move.w d0,$64(a5)        ;DMOD
  498.     move.l #$19f00002,$3e(a5)    ;CON0,CON1
  499.     move.w d1,$56(a5)        ;SIZE
  500.  
  501. *** RECHTER TEIL LINKES WORT
  502.  
  503.     eori.w #$f,d7
  504.     addq.w #1,d7
  505.     clr.w d4
  506.     bset d7,d4
  507.     ;subq.w #1,d7
  508.     subq.w #1,d4
  509.     not.w d4
  510.     ;beq Ende (==> RTS)
  511.  
  512.     moveq #38,d2
  513.     suba.w d5,a2
  514.     suba.w d5,a3
  515.  
  516.     waitblit
  517.     movem.l a2/a3,$4E(a5)        ;APT,DPT
  518.     move.l a3,$4a(a5)        ;BPT
  519.     move.w d2,$60(a5)        ;BMOD
  520.     move.w d2,$62(a5)        ;AMOD
  521.     move.w d2,$64(a5)        ;DMOD
  522.     move.w #$ffff,$44(a5)        ;LWM
  523.     move.w d4,$6e(a5)        ;CDAT
  524.     move.w #$0DE4,$3e(a5)        ;CON0
  525.     move.w #$c801,$56(a5)        ;SIZE
  526.     rts
  527.  
  528. ****************************************************************************
  529. vergroessern:
  530. ****************************************************************************
  531.  
  532. ;A0 Quellpuffer
  533. ;A1 Zielpuffer
  534. ;Bildnr. in d0
  535. ;A4 Zeiger auf OriginalBild
  536.  
  537.     lea $dff002,a5
  538.  
  539.     lea einftab(pc),a2
  540.     add.w d0,d0
  541.     move.w d0,-(a7)                 ;Tabellenoffset auf Stack retten
  542.     move.w #$9f,d6
  543.     sub.w (a2,d0.w),d6
  544.  
  545.     move.l a0,a2            ;Pufferadr. kopieren
  546.     move.l a1,a3
  547.  
  548.     move.w d6,d7
  549.     and.w #$f,d7            ;Bitpos rechts in d7
  550.     lsr.w #4,d6            ;Breite-1 in W. d6
  551.     move.w d6,d5
  552.     add.w d5,d5            ;Breite-2 in B. in d5
  553.  
  554. *** RECHTER TEIL
  555.  
  556.     lea 38(a0),a0
  557.     lea 38(a1),a1
  558.     suba.w d5,a0            ;Startadr.    
  559.     suba.w d5,a1
  560.  
  561.     moveq #38,d0
  562.     sub.w d5,d0            ;Modulo
  563.     move.w d6,d1
  564.     add.w #$c801,d1            ;Size
  565.  
  566.     waitblit
  567.     move.l #$ffffffff,$42(a5)       ;FWM,LWM
  568.     movem.l a0/a1,$4e(a5)        ;APT,DPT
  569.     move.w d0,$62(a5)               ;AMOD
  570.     move.w d0,$64(a5)        ;DMOD
  571.     move.l #$19f00000,$3e(a5)       ;CON0,CON1
  572.     move.w d1,$56(a5)        ;SIZE
  573.  
  574. *** RECHTER TEIL LINKES WORT
  575.  
  576.         lea $7d00-4(a2),a0
  577.         lea $7d00-2(a3),a1        ;Startadr.
  578.         suba.w d5,a0
  579.         suba.w d5,a1
  580.  
  581.         clr.w d4
  582.         addq.w #1,d7
  583.         bset d7,d4
  584.         subq.w #1,d7
  585.         subq.w #1,d4            ;Maske
  586.         not.w d4
  587.         ;beq next_Blit_OP
  588.  
  589.         moveq #38,d2            ;Modulo
  590.  
  591.         waitblit
  592.  
  593.         move.l a1,$4a(a5)        ;BPT
  594.         move.l a1,$4e(a5)        ;APT
  595.         move.l a1,$52(a5)        ;DPT
  596.         move.w d2,$60(a5)        ;BMOD
  597.         move.w d2,$62(a5)        ;AMOD
  598.         move.w d2,$64(a5)        ;DMOD
  599.         move.w d4,$6e(a5)        ;CDAT
  600.         move.l #$1de40002,$3e(a5)       ;CON0,CON1
  601.         move.w #$c801,$56(a5)        ;SIZE
  602.  
  603. ;next_Blit_O:P
  604.         subq.w #2,a1
  605.  
  606. *** MITTE
  607.  
  608.         moveq #18,d2
  609.         sub.w d5,d2                     ;Breite Mitte in W.
  610.         beq.s vgr_nextblit        ;falls 0, nächste Operation
  611.         moveq #40,d3
  612.         sub.w d2,d3
  613.         sub.w d2,d3            ;Modulo
  614.  
  615.         waitblit
  616.         movem.l a0/a1,$4e(a5)        ;APT,DPT
  617.         move.w d3,$62(a5)        ;AMOD
  618.         move.w d3,$64(a5)               ;DMOD
  619.         move.w d2,d3
  620.         add.w #$c800,d2
  621.         move.w #$09f0,$3e(a5)        ;CON0
  622.         move.w d2,$56(a5)        ;SIZE
  623.         add.w d3,d3
  624.         suba.w d3,a0
  625.         suba.w d3,a1
  626.  
  627. *** LINKER TEIL
  628.  
  629. vgr_nextblit:
  630.         waitblit
  631.         movem.l a0/a1,$4e(a5)        ;APT,DPT
  632.         move.w d0,$62(a5)        ;AMOD
  633.         move.w d0,$64(a5)        ;DMOD
  634.         move.w #$19f0,$3e(a5)        ;CON0
  635.         move.w d1,$56(a5)        ;SIZE
  636.  
  637. *** LINKER TEIL RECHTES WORT
  638.  
  639.         lea (a3,d5.w),a1
  640.         moveq #38,d2
  641.         clr.w d4
  642.         eori.w #$f,d7
  643.         bset d7,d4
  644.         subq.w #1,d4
  645.         ;beq nextOp
  646.  
  647.         waitblit
  648.         move.l a1,$4a(a5)        ;BPT
  649.         move.l a1,$4e(a5)        ;APT
  650.         move.l a1,$52(a5)        ;DPT
  651.         move.w d2,$60(a5)        ;BMOD
  652.         move.w d2,$62(a5)        ;AMOD
  653.         move.w d2,$64(a5)        ;DMOD
  654.         move.w d4,$6e(a5)        ;CDAT
  655.         move.l #$1de40000,$3e(a5)    ;CON0,CON1
  656.         move.w #$c801,$56(a5)        ;SIZE
  657.  
  658. ;Daten, die jetzt noch benötigt werden:
  659. ;d5 (Breite-2) in Bytes
  660. ;a3 Zielpuffer
  661. ;a4 Zeiger auf OriginalBild
  662. ;d7 Bitnummer Einfügstelle links
  663.  
  664.         move.w (a7)+,d0            ;Bildnr.
  665.  
  666. *** Zeile links einfügen
  667.  
  668.         lea ZeilenTab(pc),a2
  669.         move.w (a2,d0.w),d6        ;Origzeile Zeilentab
  670.         move.w #$9f,d1
  671.         sub.w d6,d1            ;Origzeile $9f-Zeilentab
  672.         move.w d1,d2
  673.         not.w d2
  674.         and.w #$f,d2            ;Bitpos Origzeile links
  675.         lsr.w #4,d1
  676.         add.w d1,d1                     ;Offset in OrigBild in Bytes
  677.  
  678.         lea (a4,d1.w),a0        ;Quelle OrigBild
  679.         lea (a3,d5.w),a1        ;Ziel A/D
  680.         bsr einfuegen
  681.  
  682. *** Zeile rechts einfügen
  683.  
  684.         neg.w d1
  685.         lea 38(a4,d1.w),a0
  686.         neg.w d5
  687.         lea 38(a3,d5.w),a1
  688.         eor #$f,d7
  689.         eor #$f,d2
  690.         bsr einfuegen
  691.         rts
  692.  
  693. einfuegen:    clr.w   d4
  694.         bset d7,d4
  695.         move.w d2,d3
  696.         sub.w d7,d3
  697.         bmi ef_desc
  698.  
  699. ;ascending
  700.         ror.w #4,d3            ;Barrelshifter-Bits positionieren
  701.         or.w  #$0de4,d3
  702.         waitblit
  703.         movem.l a0/a1,$4e(a5)        ;APT,DPT
  704.         move.l  a1,$4a(a5)        ;BPT
  705.         move.w  d3,$3e(a5)        ;CON0
  706.         move.w  #0,$40(a5)        ;CON1
  707.         move.w  d4,$6e(a5)              ;CDAT
  708.         move.w  #$c801,$56(a5)        ;SIZE
  709.         rts
  710.  
  711. ef_desc:    neg.w d3
  712.         ror.w #4,d3
  713.         or.w #$0de4,d3
  714.  
  715.         lea 799*40(a0),a0
  716.         lea 799*40(a1),a1
  717.         waitblit
  718.         movem.l a0/a1,$4e(a5)        ;APT,DPT
  719.         move.l  a1,$4a(a5)        ;BPT
  720.         move.w     d3,$3e(a5)        ;CON0
  721.         move.w #2,$40(a5)        ;CON1
  722.         move.w d4,$6e(a5)        ;CDAT
  723.         move.w #$c801,$56(a5)        ;SIZE
  724.         rts
  725.  
  726. ZeilenTab:    dcb.w 160,0
  727. EinfTab:     dcb.w 160,0
  728. ArbeitsTab:    dcb.w 160,0
  729.  
  730. WortTab:    dc.w 0,5,7,3,9,1,6,4,8,2
  731. BitTab:        dc.w 8,12,4,14,2,10,6,15,0,3,13,5,11,9,7,1
  732.  
  733. grname:        dc.b "graphics.library",0,0
  734. graphicsbase:    dc.l 0
  735.  
  736. cladr:        dc.w    $e2,0,$e0,0, $e6,0,$e4,0, $ea,0, $e8,0, $ee,0, $ec,0
  737.         dc.w    0,0,0
  738. cpl_mod:    dcb.b    6,0
  739.         dcb.b    200*12
  740.         dc.w    $1fc,0,$106,0
  741.         dc.w    $ffff,$fffe
  742.  
  743. planeAkt:    dc.l planes1
  744. planeVerd:    dc.l planes2
  745.  
  746. VielfachenTab:    dcb.w 202,0
  747. ModTabZeiger:    dcb.l 161,0
  748. ModuloTab:    dcb.b 33044     ;Format dc.w Coplistoffset,Anzahl,
  749.                                ;            Wert1, Wert2, ...
  750. planes1:    dcb.b 32320,0
  751. planes2:    dcb.b 32320,0
  752. origpic:    incbin    'src:phagexrips/bitmaps/transorb.raw'    ;dcb.b 32000,0
  753. col1:        dc.w    $000,$fff,$eee,$ddd,$ccc,$bbb,$aaa,$999
  754.         dc.w    $888,$777,$666,$555,$444,$333,$222,$111
  755.